package com.boco.pciv.core.exception;

/**
 * Created by CC on 2017/8/30.
 * 系统异常信息
 */
public enum PcivExceptionEnum {

    //-1 开头的为通用异常代码
    //其他为业务异常代码

    /**
     * 安全相关
     */
    AUTH_REQUEST_ERROR(1001,"认证失败"),
    TOKEN_ERROR(1002, "token验证失败"),
    TOKEN_EXPIRED(1003, "token过期"),
    SIGN_ERROR(1004, "签名验证失败"),
    REFRESH_TOKEN_ERROR(1005, "非法的RefreshToken"),

    //系统相关错误
    NotFound(1011,"未找到对应数据"),
    Config_Error(1012,"系统配置错误"),
    REQUEST_NULL(1013, "请求不能为空"),
    REQUEST_PARAM_NULL(1014,"请求参数不能为空"),
    REQUEST_PARAM_ERROR(1015,"请求数据不正确"),
    SaveData_ERROR(1016,"数据不正确"),

    //文件处理相关
    FILE_READING_ERROR(1020,"文件读取失败!"),
    FILE_NOT_FOUND(1021,"文件为找到!"),

    //未知错误
    SERVER_ERROR(1099,"服务器内部异常");

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    private String msg;
    private int code;

    PcivExceptionEnum(int code, String msg) {
        this.msg = msg;
        this.code = code;
    }
}
